package com.itheima.core;

import java.io.Serializable;
import java.sql.Connection;

import com.itheima.orm.utils.JdbcUtil;

//操作持久化对象
public class Session {
	//添加
	public void save(Object obj){
		Connection connection = JdbcUtil.getConnection();
		String dmlSql = JdbcUtil.buildDMLSql(obj.getClass().getName(),DmlSqlType.INSERT);
		JdbcUtil.executeSql(connection, obj, dmlSql, DmlSqlType.INSERT);
	}
	//更新
	public void update(Object obj){
		Connection connection = JdbcUtil.getConnection();
		String dmlSql = JdbcUtil.buildDMLSql(obj.getClass().getName(),DmlSqlType.UPDATE);
		JdbcUtil.executeSql(connection, obj, dmlSql, DmlSqlType.UPDATE);
	}
	//删除
	public void delete(Object obj){
		
	}
	//查询
	public void get(Class clazz,Serializable id){
		
	}
}
